import request from '@/utils/request'


export function listRelease(query) {
  return request({
    url: '/release/list',
    method: 'post',
    data: query
  })
}

export function updateReleaseStatus(query) {
  return request({
    url: '/release/updateReleaseStatus',
    method: 'post',
    data: query
  })
}


export function createRelease(query) {
  return request({
    url: '/release/createRelease',
    method: 'post',
    data: query
  })
}

export function updateRelease(query) {
  return request({
    url: '/release/updateRelease',
    method: 'post',
    data: query
  })
}

export function deleteRelease(query) {
  return request({
    url: '/release/deleteRelease',
    method: 'post',
    data: query
  })
}

export function fileUpload(fileobj) {
  const param = new FormData()
  param.append('file', fileobj.file)
  return request({
    method: 'post',
    url: '/release/uploadFile',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}

export function imgUpload(fileobj) {
  const param = new FormData()
  param.append('file', fileobj.file)
  return request({
    method: 'post',
    url: '/release/uploadImg',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}
